import React from 'react';
import { useNavigate } from 'react-router-dom';

const ErrorPage: React.FC = () => {
  const navigate = useNavigate();

  const handleGoHome = () => {
    navigate('/login'); // 或者您希望用户返回的任何默认页面
  };

  return (
    <div className="error-container">
      <div className="error-content">
        <h1>404</h1>
        <p>抱歉，您访问的页面不存在。</p>
        <button className="error-btn" onClick={handleGoHome}>
          返回登录页
        </button>
      </div>
    </div>
  );
};

export default ErrorPage; 